package com.translate.web.service.impl;

import com.translate.web.dao.UnitMapper;
import com.translate.entity.Unit;
import com.param.contract.IPage;
import com.translate.web.service.IUnitService;
import com.basic.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class UnitServiceImpl extends BaseServiceImpl<Unit> implements IUnitService {
	public UnitServiceImpl(UnitMapper mapper) {
		super(mapper);
	}

	protected void insertPropteris(Unit data) {
		long time = System.currentTimeMillis() / 1000;
		data.setCreateTime(time);
		data.setUpdateTime(time);
	}

	protected void updatePropteris(Unit data) {
		data.setUpdateTime(System.currentTimeMillis() / 1000);
	}

	protected <S extends IPage> String sqlByGetCounttAfterProcesser(S param) {
		return this.sqlByGetCount(" status = 1");
	}
	
	protected <S extends IPage> String sqlByGetPageListAfterProcesser(S param) {
		return this.sqlByGetPageList(" status = 1 ");
	}
	
	protected Class<Unit> getEntityClass() {
		return Unit.class;
	}
}